package com.cn.admin.controller;

import com.cn.admin.thread.MusicThread;
import com.cn.admin.utils.WebUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/test3")
    public String test3(){
       /* String tel = "15630112435";

        HashMap<String, String> map = new HashMap<>();
        map.put("Content-Type","application/x-www-form-urlencoded");

        HashMap<String, String> map1 = new HashMap<>();
        map1.put("mobile",tel);
        map1.put("name","口袋有钱");

        String jsonStr = JSON.toJSONString( map1 );


        logger.info("jsonStr===============>"+jsonStr);


        String s = HttpUtils.doPost("https://kdyouqian.com/koudai/userIosController/user_notecoller", map, jsonStr);*/
        for(int j = 0; j < 1; j ++){
            //4):在main方法(线程)中,创建线程对象,并启动线程.
            MusicThread music = new MusicThread();
            music.start();
        }
        return "1";

    }


    @PostMapping("/test4")
    public String test4(HttpServletRequest request){

        String remoteIp = WebUtils.getRemoteIp(request);
        System.out.println("================k"+remoteIp);

        return "1";
    }

}
